function Log() {
}

Log.init = function () {
    Log.id = "log";
    Log.contents = "";
    Log.level = 0;
};

Log.logWithFacility = function( fac, text ) {
    Log.logSimple( fac + "; " + text );
};

Log.logWithLevel = function( level, text ) {
    if( level >= Log.level ) {
	Log.logSimple( text );
    }
};

Log.logSimple = function( text ) {
    Log.contents += "%" + text + ".\n";
    Log.draw();
};

Log.draw = function () {
    var element = document.getElementById( Log.id );
    if( null != element ) {
	element.value = Log.contents;
    }
};

Log.init();
